#ifndef MULTIBOOT_H
#define MULTIBOOT_H

#define MULTIBOOT_HEADER_MAGIC 0x2BADB002

static const char * mbmm_types[6] = 
{
    "unknown", "usable", "reserved",
    "ACPI reclaimable", "ACPI NVS",
    "corrupted"    
};

struct __attribute__((packed)) multiboot_info
{
    uint32_t flags;
    uint32_t mem_lower;
    uint32_t mem_upper;
    uint32_t boot_device;
    uint32_t cmd_line;
    uint32_t mods_count;
    uint32_t mods_address;
    uint32_t syms[4];
    uint32_t mmap_length;
    uint32_t mmap_address;
    uint32_t drives_length;
    uint32_t drives_address;
    uint32_t config_table;
    uint32_t bootloader_name;
    uint32_t apm_table;
    uint32_t vbe_control_info;
    uint32_t vbe_mode_info;
    uint32_t vbe_mode;
    uint32_t vbe_interface_seg;
    uint32_t vbe_interface_off;
    uint32_t vbe_interface_len;
} __attribute__((packed));

struct multiboot_memory_map
{
    uint32_t size;
    uint32_t base_address_low;
    uint32_t base_address_high;
    uint32_t length_low;
    uint32_t length_high;
    uint32_t type;
};

struct multiboot_drive
{
    uint32_t size;
    uint32_t number;
    uint32_t mode;
    uint32_t cylinders;
    uint32_t heads;
    uint32_t sectors;
};

uint32_t USABLE_RAM_LOW, USABLE_RAM_HIGH;
struct multiboot_info * grub_global_mbi;

void parse_multiboot_info(struct multiboot_info * mbi, unsigned int magic);

#endif

